package offical.generic


val <T> List<T>.penultimate: T
    get() = this[size - 2]

fun main(args: Array<String>) {
    val letters = ('a'..'z').toList()
    println(letters.slice<Char>(0..2)) //intRange 转List
    println(letters.slice(10..13))

    //返回索引值=数组长度-2的值
    println(listOf(1, 2, 3, 4).penultimate)
}